package com.code.day14;

import java.util.Calendar;
import java.util.Scanner;

public class Day14CalendarKuoZhan {
    public static void main(String[] args) {
        Scanner scanner =new Scanner(System.in);
        System.out.println("请输入一个年份:");
        int year = scanner.nextInt();
        Calendar calendar = Calendar.getInstance(); //用于获取Calendar对象 因为是抽象类 不能直接new
        calendar.set(year,2,1);
        calendar.add(Calendar.DATE,-1);
        int day = calendar.get(Calendar.DATE);
        if(day == 29){
            System.out.println("是闰年");
        }else {
            System.out.println("不是闰年");
        }
    }
}
